import { Component } from "react";

import { Consumer } from './context.js';

class TopicList extends Component {
    render(){
        return (
            <div className="wrapper second">
                <Consumer>{ value => this.list( value ) }</Consumer>
            </div> 
        )
    }
    list( topics ){
        return (
            <>
            {
              topics.map( (topic,index) => {
                return (<p key={topic.id}>{index+1} : {topic.title}</p>) 
              }) 
            }
            </>
        )
    }
}

export default TopicList ;